From 9bb3b2ae3ce5e9e9a8776806211b2414f3ae8425 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Thu, 13 Feb 2014 12:08:03 -0500 Subject: [PATCH] docs: get the pixbuf options from the existing instead of hardcoding. --- docs/tools/shooter.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/tools/shooter.c b/docs/tools/shooter.c index 15e1daa224..8543318211 100644 --- a/docs/tools/shooter.c +++ b/docs/tools/shooter.c @@ -54,8 +54,12 @@ static GdkPixbuf * add_border_to_shot (GdkPixbuf *pixbuf) { GdkPixbuf *retval; + GdkColorspace colorspace; + int bits; - retval = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, + colorspace = gdk_pixbuf_get_colorspace (pixbuf); + bits = gdk_pixbuf_get_bits_per_sample (pixbuf); + retval = gdk_pixbuf_new (colorspace, TRUE, bits, gdk_pixbuf_get_width (pixbuf) + 2, gdk_pixbuf_get_height (pixbuf) + 2); @@ -78,8 +82,12 @@ remove_shaped_area (GdkPixbuf *pixbuf, XRectangle *rectangles; int rectangle_count, rectangle_order; int i; + GdkColorspace colorspace; + int bits; - retval = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, + colorspace = gdk_pixbuf_get_colorspace (pixbuf); + bits = gdk_pixbuf_get_bits_per_sample (pixbuf); + retval = gdk_pixbuf_new (colorspace, TRUE, bits, gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf)); -- 2.30.2